<template>
    <div class="block"></div>
    <van-nav-bar :title="title" left-text="返回" left-arrow @click-left="back" class="header">
        <template #right>
            <i class="iconfont icon-search"></i>
        </template>
    </van-nav-bar>
</template>

<script>
import { useRouter } from 'vue-router';
export default {
    props: {
        title: {
            type: String,
            default: ""
        }
    },
    setup() {
        const router = useRouter();
        const back = () => {
            router.back();
        }

        return {
            back
        }
    }
}
</script>

<style lang="scss" scoped>
.block {
    width: 100%;
    height: 46px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

}
</style>